package com.dingwen.stuprobooval.vo;

import com.alibaba.fastjson.JSON;
import com.dingwen.stuprobooval.constant.enu.ResultCode;
import com.dingwen.stuprobooval.constant.fac.TipAndMessage;
import lombok.*;

import java.io.Serializable;
import java.sql.Timestamp;


/**
 * 结果
 *
 * @author dingwen
 * @date 2021/05/28
 */
@Builder
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class Result implements Serializable {

    private static final long serialVersionUID = -5399051578054163779L;

    /**
     * 代码
     */
    @Builder.Default
    private int code = ResultCode.OK.code();

    /**
     * 消息
     */
    @Builder.Default
    private String message = TipAndMessage.SUCCESS;

    /**
     * 数据
     */
    @Builder.Default
    private Object data = null;


    /**
     * 当前时间
     */
    @Builder.Default
    private Timestamp currentTime = new Timestamp(System.currentTimeMillis());


    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }


}